package com.sheledon.demo.demo2.intercept;

import com.sheledon.demo.demo2.service.StudentService;
import com.sheledon.flyCat.core.aop.intercept.Interceptor;
import com.sheledon.flyCat.core.aop.intercept.MethodInvocation;

public class StudentIntercept extends Interceptor {
    @Override
    public boolean supports(Object bean) {
        return bean instanceof StudentService;
    }

    @Override
    public Object intercept(MethodInvocation methodInvocation) {
        System.out.println("老师开始监考");
        Object result = methodInvocation.proceed();
        System.out.println("考试结束");
        return result;
    }
}
